package com.bank.backend.enums;

/**
 * 币种枚举
 */
public enum CurrencyEnum {
    
    RMB("RMB", "人民币", "¥"),
    USD("USD", "美元", "$"),
    EUR("EUR", "欧元", "€"),
    JPY("JPY", "日元", "¥");
    
    private final String value;
    private final String description;
    private final String symbol;
    
    /**
     * 构造器
     */
    CurrencyEnum(String value, String description, String symbol) {
        this.value = value;
        this.description = description;
        this.symbol = symbol;
    }
    
    /**
     * 获取值
     */
    public String getValue() {
        return value;
    }
    
    /**
     * 获取描述
     */
    public String getDescription() {
        return description;
    }
    
    /**
     * 获取符号
     */
    public String getSymbol() {
        return symbol;
    }
    
    /**
     * 根据值获取枚举
     */
    public static CurrencyEnum getByValue(String value) {
        for (CurrencyEnum currency : values()) {
            if (currency.getValue().equals(value)) {
                return currency;
            }
        }
        return RMB; // 默认返回人民币
    }
} 